import { defineStore } from "pinia";
import { computed, ref } from "vue";

export const useCountStore = defineStore("count", () => {
	//state
	const count = ref(1);
	const count2 = ref(0)
	const list = ref([])
	//getter
	const doubleCount = computed(() => {
		return count.value * 2
	})
	
	//同步
	const add =()=>{
		return count.value++;
	}
	
	return {
		count,doubleCount,add
	}
})